package logic.common.team;

import java.util.ArrayList;
import java.util.List;

import logic.DelayedTPController;

public class TeamController extends DelayedTPController {
	
	private static final long serialVersionUID = 1L;
	
	private List<TeamAction> actions;
	private int actionIndex;
	
	public TeamController(Team team) {
		super(1f);
		
		actions = new ArrayList<TeamAction>();

		actions.add(new MSWeaponAction(team));
		actions.add(new DronesAction(team));
		actions.add(new CarrierAction(team));
		actions.add(new FrigateAction(team));
	}
	
	@Override
	protected void delayedUpdate(float time) {
		if(actionIndex >= actions.size()) actionIndex = 0;
		
		TeamAction action = actions.get(actionIndex);
		action.performAction();
		actionIndex++;
	}
}